import Vue from 'vue'

import Cookies from 'js-cookie'

// 样式重置
import 'normalize.css/normalize.css'

// 引入element-ui框架
import Element from 'element-ui'
import './styles/element-variables.scss'

// 全局css样式
import '@/styles/index.scss'

import App from './App'
import store from './store'
import router from './router'

import './icons'
// 权限控制
import './permission'
// 应用中的错误捕获
import './utils/error-log'
// 引入全局过滤器
import * as filters from './filters' // global filters

Vue.use(Element, {
  size: Cookies.get('size') || 'medium' // set element-ui default size
})

// 注册全局过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
